<default-header class="top-header"></default-header>
<div class="wrap no-sidebar">
  <div class="sidebar-left collapse navbar-collapse navbar-collapse-2">
    <navbar-utility-mobile></navbar-utility-mobile>
  </div>
  <div class="middle">
    <!-- Middle section -->
    <div class="middle-section surface-shaded">
      <div class="middle-container has-scroll">
        <div class="middle-content">
          <div class="container surface-shaded">
            <breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
            <div class="row">
              <div class="col-md-12">
                <alerts alerts="alerts"></alerts>
                <div ng-show="!containers.length">Loading...</div>
                <form ng-if="containers.length" name="form">
                  <h1>Resource Limits: {{name}}</h1>
                  <div class="help-block">
                    Resource limits control how much <span ng-if="!hideCPU">CPU and</span> memory a container will consume on a node.
                  </div>
                  <div class="learn-more-block">
                    <a href="{{'compute_resources' | helpLink}}" target="_blank">Learn more <i class="fa fa-external-link" aria-hidden> </i></a>
                  </div>
                  <div ng-if="showPodWarning" class="gutter-top">
                    <span class="pficon pficon-warning-triangle-o" aria-hidden="true"></span>
                    Changes will only apply to new pods.
                  </div>
                  <fieldset ng-disabled="disableInputs">
                    <div ng-repeat="container in containers"
                         ng-init="formName = container.name + '-form'">
                      <h2 ng-if="containers.length > 1">Container {{container.name}}</h2>
                      <edit-request-limit
                          resources="container.resources"
                          type="cpu"
                          limit-ranges="limitRanges"
                          ng-if="!hideCPU">
                      </edit-request-limit>
                      <edit-request-limit
                          resources="container.resources"
                          type="memory"
                          limit-ranges="limitRanges">
                      </edit-request-limit>
                    </div>
                    <div ng-repeat="problem in cpuProblems" class="has-error">
                      <span class="help-block">{{problem}}</span>
                    </div>
                    <div ng-repeat="problem in memoryProblems" class="has-error">
                      <span class="help-block">{{problem}}</span>
                    </div>
                    <div class="button-group gutter-top gutter-bottom">
                      <button type="submit"
                        class="btn btn-primary btn-lg"
                        ng-click="save()"
                        ng-disabled="form.$invalid || disableInputs || cpuProblems.length || memoryProblems.length"
                        value="">Save</button>
                      <a class="btn btn-default btn-lg" ng-href="{{resourceURL}}">Cancel</a>
                    </div>
                  </fieldset>
                </form>
              </div>
            </div>
          </div>
        </div><!-- /middle-content -->
      </div><!-- /middle-container -->
    </div><!-- /middle-section -->
  </div><!-- /middle -->
</div><!-- /wrap -->


